package com.sc.web.gwt.client.service;

import com.google.gwt.core.client.GWT;
import com.google.gwt.user.client.rpc.RemoteService;
import com.google.gwt.user.client.rpc.RemoteServiceRelativePath;
import com.sc.web.gwt.shared.model.Admin;
import com.sc.web.gwt.shared.model.AgentAdmin;

/**
 * User: KienCT
 * Date: 30/06/2011
 * Time: 00:06
 */
@RemoteServiceRelativePath("GetUserService")
public interface GetUserService extends RemoteService {

    String isUserLoggedIn();

    void logOut();

    AgentAdmin isAgentAdminValid(String userName, String password);

    Admin isAdminValid(String userName, String password);

    /**
     * Utility/Convenience class.
     * Use GetUserService.App.getInstance() to access static instance of getUserServiceAsync
     */
    public static class App {
        private static final GetUserServiceAsync ourInstance = (GetUserServiceAsync) GWT.create(GetUserService.class);

        public static GetUserServiceAsync getInstance() {
            return ourInstance;
        }
    }
}
